Skip to content

Conversation

@mudler
Copy link
Owner

@mudler mudler commented Jul 19, 2024

Description

This PR disable grammar by default and make that opt-in. More and more models now support function calling, and grammar support is better to be enabled on these model that fits this logic, or alternatively enabled when want to constrain models that doesn't support function calls directly.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@netlify
Copy link

netlify bot commented Jul 19, 2024

Deploy Preview for localai ready!

Name Link
🔨 Latest commit 4ebf3c7
🔍 Latest deploy log https://app.netlify.com/sites/localai/deploys/669a15832e6d9c00088c95c5
😎 Deploy Preview https://deploy-preview-2919--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Repository owner deleted a comment from localai-bot Jul 19, 2024
@localai-bot
Copy link
Contributor

This PR diff introduces a few changes:

  1. In core/http/endpoints/openai/chat.go, there is a change in the condition for using a grammar function. Previously, the condition was !config.FunctionsConfig.GrammarConfig.NoGrammar && shouldUseFn. Now, the condition has been updated to config.FunctionsConfig.GrammarConfig.EnableGrammar && shouldUseFn. This change allows the grammar parsing to be enabled or disabled based on the EnableGrammar field in the configuration.

  2. In the gallery/mudler.yaml file, there is an addition of the grammar field under the function section. The grammar field has a sub-field enable which is set to true. This enables the grammar parsing for the Mudler gallery.

  3. In pkg/functions/parse.go, there is a change in the GrammarConfig struct. The NoGrammar field has been renamed to EnableGrammar, and its type has been updated to a boolean. This change aligns with the changes made in the chat.go file.

These changes seem to be related to enabling or disabling grammar parsing in the OpenAI chat functionality. The logic for grammar parsing has been updated to consider an EnableGrammar boolean flag in the configuration, allowing the feature to be toggled on or off depending on the specific use-case.

@github-actions
Copy link

This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Aug 26, 2025
@github-actions
Copy link

This PR was closed because it has been stalled for 10 days with no activity.

@github-actions github-actions bot closed this Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants